package com.wyth.lottery.activity;

import android.content.Intent;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wyth.lottery.R;
import com.wyth.lottery.base.BaseActivity;
import com.wyth.lottery.utils.ToastUtil;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class QThreeActivity extends BaseActivity {
    private RecyclerView rvQThree;
    @Override
    protected int getContentID() {
        return R.layout.activity_qthree;
    }

    @Override
    protected void initView() {
        rvQThree = (RecyclerView) findViewById(R.id.rv_qthree);
        initRecyclerView();
    }

    private void initRecyclerView() {
        //数据集合
        LinearLayoutManager linearLayoutManager =new LinearLayoutManager(QThreeActivity.this);
        rvQThree.setLayoutManager(linearLayoutManager);
        ArrayList<String> list =new ArrayList<>();
        list.add("和值");
        list.add("二同号");
        list.add("三同号");
        list.add("二不同号");
        list.add("三不同号");
        list.add("三连号");
        SeifAdapter seifAdapter = new SeifAdapter(list);
        rvQThree.setAdapter(seifAdapter);
    }

    @Override
    protected void initDate() {

    }

    class SeifAdapter extends BaseQuickAdapter<String,BaseViewHolder> {

        public SeifAdapter(List<String> data) {
            super(R.layout.textview_three, data);
        }

        @Override
        protected void convert(final BaseViewHolder helper, final String item) {
            helper.setText(R.id.tv_button,item);
            TextView tvButton = helper.getView(R.id.tv_button);
            tvButton.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent=new Intent();
                    intent.setClass(QThreeActivity.this, QThreeSelectActivity.class);
                    intent.putExtra("int_data",helper.getLayoutPosition());
                    startActivity(intent);
                }
            });
        }
    }
}
